package com.zy.test.widget

import androidx.fragment.app.Fragment
import com.zy.activity.BaseMainActivity
import com.zy.test.widget.WidgetConstant.WIDGET_TYPE
import com.zy.test.widget.WidgetConstant.WIDGET_TYPE_BOTTOMNAVIGATIONVIEW
import com.zy.test.widget.WidgetConstant.WIDGET_TYPE_JETPACK_CARD_VIEW
import com.zy.test.widget.WidgetConstant.WIDGET_TYPE_JETPACK_EMOJI
import com.zy.test.widget.WidgetConstant.WIDGET_TYPE_RADIO_GROUP
import com.zy.test.widget.WidgetConstant.WIDGET_TYPE_SETTINGS
import com.zy.test.widget.fragment.BottomNavigationViewFragment
import com.zy.test.widget.fragment.RadioGroupFragment
import com.zy.test.widget.fragment.SettingsFragment
import com.zy.test.widget.jetpack.CardviewFragment
import com.zy.test.widget.jetpack.EmojiFragment

class WidgetMainActivity : BaseMainActivity() {
    override val containerFragment: Fragment
        get() {
            return when (intent.getIntExtra(WIDGET_TYPE, WIDGET_TYPE_SETTINGS)) {
                WIDGET_TYPE_BOTTOMNAVIGATIONVIEW -> BottomNavigationViewFragment.newInstance()
                WIDGET_TYPE_RADIO_GROUP -> RadioGroupFragment.newInstance()
                WIDGET_TYPE_JETPACK_CARD_VIEW -> CardviewFragment.newInstance()
                WIDGET_TYPE_JETPACK_EMOJI -> EmojiFragment.newInstance()
                else -> {
                    SettingsFragment.newInstance()
                }
            }
        }
}